package com.chenglu.android.couponcenter.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chenglu.android.R;
import com.chenglu.android.common.utils.GlideUtils;
import com.chenglu.android.common.utils.Utils;
import com.chenglu.android.goodsinfo.bean.ShopCouponPage;
import com.chenglu.android.index.bean.IndexRecomBean;

import java.util.List;

/**
 * @author: lyj
 * @Created: by Copyright 2023/3/13 Guangzhou Hongma Technology Co., Ltd. All rights reserved.
 * @Description：首页详情商品推荐的数据
 */
public class CouponItemAdapter extends BaseQuickAdapter<ShopCouponPage.Data.Records.GoodsList, BaseViewHolder> {

    private Context context ;

    private  int mSupply;
    public CouponItemAdapter(@Nullable Context context, List<ShopCouponPage.Data.Records.GoodsList> data) {
        super(R.layout.item_coupon_pic, data);
        this.context = context;

    }



    @Override
    protected void convert(@NonNull BaseViewHolder helper, ShopCouponPage.Data.Records.GoodsList item) {


        if(item!=null){

//            LogUtils.e("HomePicAdapter","picadapter中的数据"+item.toString());

            TextView textView = helper.getView(R.id.item_tv_detail_money);
            ImageView imageView = helper.getView(R.id.item_iv_detail);
            textView.setText(Utils.formatZeroNumber(item.getGoodsPrice()));
            helper.setText(R.id.item_tv_des,item.getGoodsName());

            GlideUtils.setImageView(context,item.getGoodsImg(),imageView,8);
        }
    }
}
